﻿<div class="page-container" id="admui-pageContent">
    <div class="page animation-fade page-forms">
        <div class="page-header">
            <h1 class="page-title">添加案场</h1>
            <ol class="breadcrumb">
                <li class="breadcrumb-item">
                    <a class="icon wb-home" href="javascript:;">案场管理</a>
                </li>
                <li class="breadcrumb-item active">添加案场</li>
            </ol>
        </div>
        <div class="page-content">
            <div class="panel">
                <div class="panel-body">
                    <div class="example-wrap">
                        <div class="example">
                            <div class="form-group">
                                <label class="control-label" for="anchangmingcheng">案场名称</label>
                                <input type="text" class="form-control" id="anchangmingcheng" name="anchangmingcheng" placeholder="案场名称" autocomplete="off" />
                            </div>
                            <div class="form-group">
                                <div class="col-sm-1">
                                    <input type="button" id="TianJia" onclick="Add()" class="btn btn-block btn-info" value="添加" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $("#AnChangGuanLi").click();
    });

    function Add() {
        var anchangmingcheng = $("#anchangmingcheng").val();
        if (anchangmingcheng == "") {
            alert("案场名称不能为空");
        }   else {
            $.ajax({
                type: 'post',
                url: '../AnChang/AnChangTianJia',
                dataType: 'text',
                async: true,
                data: { anchangmingcheng: anchangmingcheng},
                success: function (result) {
                    if (result == "1") {
                        var boo = confirm('添加成功! 是否跳转到案场列表页面?')
                        if (boo) {
                            location.href = "../AnChang/AnChangList";
                        } else {
                        }
                    } else {
                        alert("添加失败");
                    }
                }
            });
        }
    }
</script>